package com.ctp.ui.table.renderer;

import java.awt.Component;

import javax.swing.JLabel;
import javax.swing.JTable;
import javax.swing.UIManager;
import javax.swing.table.TableCellRenderer;

public class TableStringRenderer implements TableCellRenderer {

	private JLabel label = new JLabel();

	public TableStringRenderer() {
		label.setFont(UIManager.getFont("Table.font"));
		label.setHorizontalAlignment(JLabel.CENTER);
	}

	public Component getTableCellRendererComponent(JTable table, Object value,
			boolean isSelected, boolean hasFocus, int row, int column) {
		label.setText(value == null ? "" : value.toString());
		return label;
	}

}
